﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Polly;

namespace SageKing.Options;

public class SageKingOpenTelemetryOptions
{
    public const string SectionName = "SageKingOpenTelemetry";

    public Trace Trace { get; set; }

    public bool HasFilterURLPrefix
    {
        get
        {
            return this != null && Trace != null && Trace.FilterURLPrefix != null && Trace.FilterURLPrefix.Count > 0;
        }
    }

    public bool HasFilterTags
    {
        get
        {
            return Trace != null && Trace.FilterTags != null && Trace.FilterTags.Count > 0;
        }
    }
    public bool HasFilterNames
    {
        get
        {
            return this != null && Trace != null && Trace.FilterNames != null && Trace.FilterNames.Count > 0;
        }
    }
}

public class Trace
{
    /// <summary>
    /// 
    /// </summary>
    public List<string> FilterNames { get; set; }

    public List<Dictionary<string, object>> FilterTags { get; set; }

    /// <summary>
    /// url.path 前缀
    /// </summary>
    public List<string> FilterURLPrefix { get; set; }

}